package xyz.weizhi.tanhua.dubbo.api;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import xyz.weizhi.tanhua.dubbo.mapper.QuestionMapper;
import xyz.weizhi.tanhua.model.domain.Question;

/**
 * @Author milian
 * @Date 2021/10/24 0024 16:21
 */
@DubboService
public class QuestionApiImpl extends ServiceImpl<QuestionMapper,Question> implements QuestionApi{
    @Autowired
    private QuestionMapper questionMapper;
    @Override
    public Question findByUserId(Long userId) {
        QueryWrapper<Question> qw = new QueryWrapper<>();
        qw.eq("user_id", userId);
        return questionMapper.selectOne(qw);
    }
}
